﻿namespace com.stifel.Exceptions.SharePointExceptions
{
    using System;

    [Serializable]
    public class FeatureActivationException : Exception
    {
        #region Constructors

        public FeatureActivationException( )
            : base("The feature activation failed.")
        {
        }

        public FeatureActivationException( Guid featureId, string title, string url )
            : base(GetMessage( featureId, title, url ))
        {
        }

        public FeatureActivationException( Guid featureId, string title, string url, Exception innerException )
            : base(GetMessage( featureId, title, url ), innerException)
        {
        }

        #endregion Constructors

        #region Methods

        public static string GetMessage( Guid featureId, string title, string url )
        {
            return string.Format( "The feature activation failed. The specified feature {0} ({1}) was not successfully activated at '{2}'.", featureId, title, url );
        }

        #endregion Methods
    }
}